package study.dubbo.springcloud.consumer.controller;

import lombok.extern.slf4j.Slf4j;
import org.apache.dubbo.config.annotation.DubboReference;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import study.dubbo.api.service.ExceptionService;
import study.dubbo.springcloud.consumer.support.result.Result;
import study.dubbo.springcloud.consumer.support.result.Results;

@Slf4j
@RestController
public class ExceptionController {

    @DubboReference
    private ExceptionService exceptionService;

    @RequestMapping("/throwEx")
    public Result throwEx() {
        exceptionService.throwEx("test");
        return Results.ok();
    }
}
